import { request } from '@boeyo/portal';

/**
 * 地震预警产出列表
 * null
 */
export const earthquakeList = (params) => {
  return request({
    url: '/earthquake/list',
    method: 'GET',
    params,
  });
};

/**
 * 删除
 * @ss.hasPermi('powerSupply:remove')
 */
export const delEarthquake = (ids) => {
  return request({
    url: `/earthquake/${ids}`,
    method: 'DELETE',
  });
};

/**
 * 历史数据波形
 */
export const fetchHistoryData = (params) => {
  return request({
    url: 'deviceData/history',
    params,
    skipError: true,
  });
};

/**
 * 报告产出文件下载
 * null
 */
export const downloadGenerateById = (generateId, docType = 'pdf') => {
  return request({
    url: `/produce/downloadGenerateById/${generateId}/${docType}`,
    method: 'GET',
    responseType: 'blob',
    closeDownload: true,
  });
};

/**
 * 生成地震速报报告
 * null
 */
export const createNormalWarningDataReport = (id) => {
  return request({
    url: `/produce/createNormalWarningDataReport/${id}`,
    method: 'GET',
    skipError: true,
  });
};

/**
 * 傅立叶谱
 * null
 */
export const signal = (data) => {
  return request({
    url: `/deviceData/signal`,
    method: 'post',
    data,
  });
};

/**
 * 反应谱
 * null
 */
export const responseSpectrum = (data) => {
  return request({
    url: `/deviceData/responseSpectrum`,
    method: 'post',
    data,
  });
};
